package org.chunchu.todo.model;

import java.io.Serializable;

import android.widget.EditText;

public class Category implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4149627229545386676L;
	private long id;
	private String name;

	public Category() {

	}

	public Category(String name) {
		super();
		this.name = name;
	}

	public Category(long id, String name) {
		super();
		this.id = id;
		this.name = name.trim();
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void applyTo(EditText edtName) {
		edtName.setText(name);
	}

	public static Category from(EditText edtName) {
		return new Category(edtName.getText().toString());
	}

}
